//引入模块
const express = require('express')
const userRouter = require('./routes/user.js')
const masterRouter = require('./routes/master.js')
const cors = require('cors')
const bodyParser = require('body-parser');
//创建服务器
const app = express()
// 设置监听端口
app.listen(3000, () => {
  console.log('server is running...')
})
app.use(cors({
  origin: '*'
}))
app.use(bodyParser.urlencoded({
  extended: false
}))

app.use('/user', userRouter)
app.use('/master', masterRouter)

